package com.itheima.day04.myinnerclass.test7;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        // 匿名类部类
        useFlyable(new Flyable() {
            @Override
            public void fly(String str) {
                System.out.println(str + "是一个大~~~帅哥");
            }
        });

        // Lambda表达式
        useFlyable((String str) -> {
            System.out.println(str);
        });

    }

    public static void useFlyable(Flyable f){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入");
        String str = sc.next();
        f.fly(str);
    }
}

interface Flyable {
    void fly(String s);
}
